<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登录之验证码测试</title>
</head>
<body>
<form action="/login" method="post">
    请输入验证码：<input type="text" name="code">
    <img th:src="@{/captcha}" id="captcha" style="width:100px;height:40px;" class="mr-2"/>
    <a href="javascript:refresh_captcha();" class="font-size-12 align-bottom">刷新验证码</a>
    <input type="submit" value="提交">
</form>

<!--<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>-->
<script th:src="@{/js/jquery-1.10.2.min.js}"></script>
<script>
    function refresh_captcha() {
        var path = "/captcha?p=" + Math.random();
        $("#captcha").attr("src", path);
    }
</script>

</body>
</html>
